<template>
    <div class="myBox" :style="{background:'url('+LoginUser.cover+')'}">
        <div class="L"><img :src="LoginUser.avatar" /></div>
        <div class="C">
            <div class="tit">{{LoginUser.nickname ? LoginUser.nickname : '请设置昵称'}}</div>
            <div class="sub">{{LoginUser.email}}</div>
        </div>
        <div class="R"><img src="/assets/images/go.png" /></div>
    </div>
    <div class="clear"></div>
    <div class="allkbox"></div>
    <div class="myboxcon" @click="profile">
        <p>修改资料</p>
        <img src="/assets/images/go.png">
    </div>
    <div class="myboxcon" @click="email">
        <p>邮箱认证</p>
        <img src="/assets/images/go.png">
    </div>
    <div class="myboxcon" @click="address">
        <p>我的收货地址</p>
        <img src="/assets/images/go.png">
    </div>
    <div class="myboxcon" @click="order">
        <p>我的订单</p>
        <img src="/assets/images/go.png">
    </div>
    <div class="myboxcon" @click="contion">
        <p>消费记录</p>
        <img src="/assets/images/go.png">
    </div>
    <div class="myboxcon">
        <p>充值记录</p>
        <img src="/assets/images/go.png">
    </div>
    <div class="myboxcon" @click="logout">
        <p>退出账号</p>
        <img src="/assets/images/go.png">
    </div>

    <div class="clear"></div>
    <div class="h54"></div>
    <div class="clear"></div>
    <!-- 底部导航 -->
    <Menus />
</template>
<script>
import Menus from 'components/common/Menus.vue'
export default {
    components:{
        Menus
    },
    data()
    {
        return{
            LoginUser:this.$cookies.get('LoginUser')?this.$cookies.get('LoginUser'):{}
        }
    },
    methods: {
        logout()
        {
            this.$dialog.confirm({
                title: '确认退出？',
                message:'您确认退出当前登录的账号'
            })
            .then(() => {
               this.$cookies.remove('LoginUser')
               this.$notify({
                    type: "success",
                    message: '已退出',
                    duration:1500,
                    onClose:() => {
                        this.$router.push('/')
                    }
                });
                return false
            })
            .catch(() => {
                // on cancel
            });

        },
        profile()
        {
            this.$router.push('/user/base/profile')
        },
         address()
        {
            this.$router.push('/user/address/index')
        },
        email()
        {
            this.$router.push('/user/base/email')
        },
        order()
        {
            this.$router.push('/Order/order/index')
        },
        contion()
        {
            this.$router.push('/Order/order/contion')
        }
    },
}
</script>